package com.fcat.springboot.mybatis.mapper;

import com.fcat.springboot.mybatis.mapper.provider.UpdateListMapperProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.UpdateProvider;
import tk.mybatis.mapper.annotation.RegisterMapper;

import java.util.List;

/**
 * @BelongsProject: fcat-base
 * @BelongsPackage: com.fcat.springboot.mybatis.mapper.provider
 * @Author: xiangfei
 * @CreateTime: 2021-07-07
 */

@RegisterMapper
public interface UpdateListMapper<T> {
    /**
     * 批量修改   根据id去修改
     *
     * @param list
     * @return
     */
    @UpdateProvider(type = UpdateListMapperProvider.class, method = "dynamicSQL")
    int updateListById(@Param("list") List<T> list);
    /**
     * 批量修改   根据id去修改  不修改null值
     *
     * @param list
     * @return
     */
    @UpdateProvider(type = UpdateListMapperProvider.class, method = "dynamicSQL")
    int updateListSelective(@Param("list") List<T> list);
}
